//
//  TSBaseViewController.m
//  TaShuo
//
//  Created by N-X on 2018/3/5.
//  Copyright © 2018年 MRNAN. All rights reserved.
//

#import "TSBaseViewController.h"

@interface TSBaseViewController ()

@end

@implementation TSBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationBarHeight = statusBarRect.size.height +  self.navigationController.navigationBar.frame.size.height;
    self.tabBarHeight = self.tabBarController.tabBar.bounds.size.height;
    [self setUpNavigationBar];
}

- (void)setUpNavigationBar
{
    UIButton * locationbBtn = [[UIButton alloc]init];//WithFrame:CGRectMake(0, 0, 90, 25)];
    [locationbBtn setTitle:@"洛杉矶" forState:UIControlStateNormal];
    locationbBtn.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    locationbBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [locationbBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [locationbBtn setImage:[UIImage imageNamed:@"locationIcon"] forState:UIControlStateNormal];
    [locationbBtn sizeToFit];
    [locationbBtn layoutButtonWithEdgeInsetsStyle:ButtonEdgeInsetsStyleImageLeft imageTitlespace:2];
    
    [locationbBtn addTarget:self action:@selector(locationAction) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem * leftItem = [[UIBarButtonItem alloc]initWithCustomView:locationbBtn];
    self.navigationItem.leftBarButtonItems = @[leftItem];
    //    self.locationButton = locationbBtn;
    
    FHNavigationBarScanView * scanView = [[FHNavigationBarScanView alloc]initWithFrame:CGRectMake(0, 0, 35, 25)];
    UIBarButtonItem * scanItem = [[UIBarButtonItem alloc]initWithCustomView:scanView];
    self.navigationItem.rightBarButtonItems = @[scanItem];
    
    FHNavigationBarSearchView * searchView = [[FHNavigationBarSearchView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth * 0.7, 35)];
    self.navigationItem.titleView = searchView;
}

#pragma mark - 点击事件

- (void)locationAction
{
    
}
@end
